import java.util.*;

public class RTLSymbolTable {
    RTLGlobalSymbolTable globalSymbolTable;
    Map<String, EntryInfo> table;
    String returnLabel;
        
    public RTLSymbolTable(RTLGlobalSymbolTable _globalSymbolTable,String _returnLabel){
	table =  new HashMap<String, EntryInfo>();
	globalSymbolTable = _globalSymbolTable;
	returnLabel = _returnLabel;
    }

    public String getReturnLabel()
    {
	return returnLabel;
    }
    
    public boolean insert(String s, EntryInfo t)
    {
	if (table.get(s) != null)
	    return false;
	table.put(s,t);
	return true;
    }
    
    
    public EntryInfo lookup(String s) {
	EntryInfo ei = table.get(s);

	if(ei!=null)
	    return ei;
	
	return globalSymbolTable.lookup(s);
    }
    
}